#{extends 'main.html' /}
#{set title:'首页' /}
<link rel="stylesheet" type="text/css" href="/public/sui/layer_mobile/need/layer.css">
<script type="text/javascript" src="/public/sui/js/list.js"></script>
<script type="text/javascript" src="/public/sui/layer_mobile/layer.js"></script>
<script type="text/javascript" src="/public/sui/js/qrcode.min.js"></script>
<script type="text/javascript">
    var qrCodeBase = "${qrCodeBase}";
    var isAndroid = null ;
    var qrCode_div_length = 350 ;
    var qrcode_length = 260;
//         var $jq= jQuery.noConflict();
    $(function () {
        //获取手机宽度
        iphonehirhtandwidth();

        $(".lunbo").swiper({
            autoplay: 3000  //可选选项，自动滑动
        });

        // 检测高度

        $(".content").on("scroll", function () {
            if ($('.content').scrollTop() > 100) {
                $('.bar-nav0').addClass("active");
            } else {
                $('.bar-nav0').removeClass("active");
            }
        });

    })

    function createQR() {
        layer.open({
            style:'width: '+qrCode_div_length+'px;height: '+qrCode_div_length+'px;' ,
            content: '<div id="qrCode_id" class="qrCodeDelivery" style="width: 100%;height: 90%; "></div>'
        });

        $('#qrCode_id').html('');
        var url = qrCodeBase;
        var qrcode = new QRCode(document.getElementById("qrCode_id"), {width: qrcode_length, height: qrcode_length});
        qrcode.clear();
        qrcode.makeCode(url);

    }

    //获取手机宽度
    function iphonehirhtandwidth() {
        var windowWidth = $(window).width();//浏览器当前窗口可视区域宽度
        qrCode_div_length = windowWidth-30*2 ;
        qrcode_length = qrCode_div_length-80;
    }
</script>

<body>
<div class="page-group home">
    <div class="page">
        <header class="bar bar-nav0">
            <a href="#" class="title">商家管理主页</a>
        </header>
        <section id="page-swiper" class="index content scroll_y" style=" top:0; ">
            <div class="swiper-container lunbo" data-space-between='0'>
                <div class="swiper-wrapper">
                    <div class="swiper-slide"><img src="/public/sui/images/banner.jpg" alt=""></div>
                    <div class="swiper-slide"><img src="/public/sui/images/banner1.jpg" alt=""></div>
                    <div class="swiper-slide"><img src="/public/sui/images/banner2.jpg" alt=""></div>
                    <div class="swiper-slide"><img src="/public/sui/images/banner3.jpg" alt=""></div>
                </div>
                <div class="swiper-pagination"></div>
            </div>
            <div class="mainnav m5">
                <a href="/setUp/index" external><i class="ma0 iconfont">&#xe607;</i><em>首页设置</em></a>
                <a href="/merchant/index" external><i class="ma1 iconfont">&#xe627;</i><em>商户资料</em></a>
                <a href="/product/list" external><i class="ma2 iconfont">&#xe636;</i><em>产品管理</em></a>
                <a href="/order/list" external><i class="ma3 iconfont">&#xe626;</i><em>订单管理</em></a>
                <a href="/bill/index" external><i class="ma4 iconfont">&#xe62e;</i><em>财务管理</em></a>
                <a href="/report/index" external><i class="ma5 iconfont">&#xe60c;</i><em>投诉管理</em></a>
                <a href="/statistics/index" external><i class="ma5 iconfont">&#xe684;</i><em>商家报表</em></a>
                <a href="#" class="kong"><i class="iconfont">&#xe60c;</i><em>占位</em></a>
                <a href="#" class="kong"><i class="iconfont">&#xe60c;</i><em>占位</em></a>
            *{   <a href="/user/indexUser" external><i class="ma5 iconfont">&#xe60c;</i><em>个人中心</em></a>}*

            </div>

            <footer class="bar bar-tab">
                <a class="tab-item external " href="/${merchant.linkId}">
                    <span class="icon iconfont">&#xe606;</span>
                    <span class="tab-label">首页</span>
                </a>
                <a id="click_QR_code" class="tab-item external QR_code" href="#"  >
                    <div class="QR_code" onclick="createQR()">
                        <span class="icon iconfont">&#xe75e;</span>
                        <span class="tab-label">商户二维码</span>
                    </div>
                </a>
                <a class="tab-item external" href="/login/loginOut" >
                    <span class="icon iconfont">&#xe614;</span>
                    <span class="tab-label">退出</span>
                </a>

            </footer>

        </section>
    </div>
</div>
<script>$.init();</script>

</body>